//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.aidong.dao.wills;

import com.aidong.dao.base.OrderSet;
import com.aidong.dao.wills.BaseDao;
import com.aidong.model.wills.WorkflowFile;
import java.util.List;
import org.springframework.stereotype.Repository;

@Repository
public class WorkflowFileDao extends BaseDao<WorkflowFile, Integer> {
	public WorkflowFileDao() {
	}

	public List<WorkflowFile> getListByWorkflowId(int workflowId) {
		return this.queryList("workflowId=:p1", new Object[]{Integer.valueOf(workflowId)}, (new OrderSet()).desc("autoId"), -1);
	}

	public void addFile(WorkflowFile file) {
		this.add(file);
		String sql = "update WorkflowList set fileNum=fileNum+1, updateTime=getdate() where workflowId=:p1";
		this.updateBySql(sql, new Object[]{file.getWorkflowId()});
	}
}
